<template>
    <div class="pagination">
        <el-pagination
            :background="true"
            layout="prev, pager, next"
            :total="total"
            v-model:current-page="pageNum"
            :page-size="pageSize"
            @current-change="handleCurrentChange"
        />
    </div>
</template>

<script setup lang="ts">
import { defineProps, toRefs, defineEmits } from 'vue';
let props = defineProps(['total', 'pagination']);
let emit = defineEmits(['handleCurrentChange']);
let { pageNum, pageSize } = toRefs(props.pagination);
function handleCurrentChange(val: number): void {
    emit('handleCurrentChange', val);
}
</script>

<style scoped lang="scss">
.pagination {
    margin-top: 10px;
}
</style>
